package lib.bone.audit.workload.domain.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lib.bone.access.validator.IsWorkloadSource;
import lib.bone.access.validator.IsWorkloadType;
import lombok.Data;

import javax.persistence.Column;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@ApiModel("工作量记录新增DTO")
public class NepuWorkloadAddDTO {
    /**
     * 工作量附加信息
     */
//    @NotBlank(message = "工作量记录附加信息不可为空")
    @ApiModelProperty(value = "工作量记录附加信息",notes = "JsonObject -> Str")
    String workloadAttach;

//    @IsWorkloadType
    @ApiModelProperty(value = "工作量类型",notes = "科研工作量，教学工作量，管理工作量，兼职工作量")
    String workloadType;
    /**
     * 工作量来源统计
     */
    @IsWorkloadSource
    @ApiModelProperty(value = "工作量来源",notes = "负责人分配,管理员分配,申请获得")
    String workloadSource;

    /**
     * 工作量级别
     */
//    @NotBlank(message = "工作量级别不可为空")
    @ApiModelProperty(value = "工作量级别",notes = "科研工作量专属字段，其余为缺省值*")
    String workloadLevel;

    /**
     * 工作量归属周期ID
     */
    @NotBlank(message = "周期ID不可为空")
    @ApiModelProperty("周期ID")
    String cycleId;

    @ApiModelProperty(value = "科研项目ID")
    @Column(name = "link_Id")
    String linkId;

    /**
     * 工作量归属父周期ID
     */
    @NotBlank(message = "父周期ID不可为空")
    @ApiModelProperty(value = "父周期ID")
    String parentId;

    /**
     * 对应用户ID
     */
    @NotNull(message = "用户ID不可为空")
    @ApiModelProperty(value = "用户ID",notes = "对应 system-user 表 ID")
    Long userId;

    @NotNull(message = "工作量不可为空")
    @ApiModelProperty(value = "工作量",notes = "")
    Double workload;

    @Min(value = 1,message = "范围1-3")
    @Max(value = 3,message = "范围1-3")
    @ApiModelProperty(value = "锁等级",notes = "0 ~ 3")
    Integer workloadLock;
}
